﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Register Src="../../../../_controltemplates/15/MII_FIF/Header.ascx" TagPrefix="UC" TagName="Header" %>
<%@ Register Src="../../../../_controltemplates/15/MII_FIF/LeftMenu.ascx" TagPrefix="UC" TagName="LeftMenu" %>
<%@ Register Src="../../../../_controltemplates/15/MII_FIF/Header.ascx" TagPrefix="UC" TagName="PageHeader" %>

<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FormDataKunjungan.aspx.cs" Inherits="MII_FIF.Layouts.MII_FIF.DataKunjungan.FormDataKunjungan" DynamicMasterPageFile="~masterurl/default.master" %>

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">

</asp:Content>

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
<link href="../JQuery/jquery-ui-1.10.3.custom/css/ui-lightness/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" />
    <script src="../JQuery/jquery-ui-1.10.3.custom/js/jquery-1.9.1.js" type="text/javascript"></script>
    <script src="../JQuery/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script>
    <link href="../Style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function MyDatePickerInit() {

            $(function () {
                $("#<%= txtDate.ClientID %>").datepicker({
                    dateFormat: 'd M yy', changeMonth: true, changeYear: true, yearRange: "c-100:c+100",
                    monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
                });
            });

            $('.DatePicker').datepicker({
                dateFormat: 'd M yy', changeMonth: true, changeYear: true, yearRange: "c-100:c+100",
                monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
            });
            $(function () {
                $('#<%= txtDate.ClientID %>').attr('readonly', true);
            });
            $(".DatePicker").attr('readonly', true);
        }

        var prm = Sys.WebForms.PageRequestManager.getInstance();
        prm.add_endRequest(EndRequest);
        function EndRequest(sender, args) {
            MyDatePickerInit();
        }

        $(function () {
            MyDatePickerInit();
        });

        function CheckTheCheckBoxes(dename) {
            var deid = "";
            var elem = document.forms[0].elements;
            for (var i = 0; i < elem.length; i++) {
                if (elem[i].name != null) {
                    if (elem[i].name.indexOf(dename) != -1) {
                        if (elem[i].disabled == false) {
                            elem[i].checked = document.getElementById('chkSelectAll1').checked;
                        }
                    }
                }
            }
            return deid;
        }
        function CheckTheCheckBoxes2(dename) {
            var deid = "";
            var elem = document.forms[0].elements;
            for (var i = 0; i < elem.length; i++) {
                if (elem[i].name != null) {
                    if (elem[i].name.indexOf(dename) != -1) {
                        if (elem[i].disabled == false) {
                            elem[i].checked = document.getElementById('chkSelectAll2').checked;
                        }
                    }
                }
            }
            return deid;
        }
    </script>
    
<div>
<table class="TableLuar">
            <tr>
                <td class="LeftMenu">
                    <UC:LeftMenu runat="server" id="LeftMenu" />
                </td>
                <td style="vertical-align: top;">
        <table class="TableDalam">
            <tr>
                <td colspan="3">
                    <UC:PageHeader runat="server" ID="Header"></UC:PageHeader>
                </td>
            </tr>
        <tr>
            <td class="KolomKiri">PIC HO</td><td style="width:5px">:</td><td style="font-weight:bold;"><asp:Label runat="server" id="lblLogin"></asp:Label></td>
        </tr>
        <tr>
	        <td>Tanggal</td><td>:</td><td><asp:TextBox runat="server" id="txtDate" Width="75px"></asp:TextBox></td>
        </tr>
        <tr>
	        <td>Lokasi</td><td>:</td><td><asp:DropDownList runat="server" id="ddlLokasi" AutoPostBack="true" OnSelectedIndexChanged="ddlLokasi_SelectedIndexChanged">
            </asp:DropDownList></td>
        </tr>
        <tr>
	        <td>Telepon</td><td>:</td><td><asp:Label runat="server" id="lblTelepon"></asp:Label></td>
        </tr>
        <tr>
	        <td>PIC Cabang/Pos</td><td>:</td><td><asp:Label runat="server" id="lblPICCabang"></asp:Label></td>
        </tr>
        <tr>
	        <td>Telp. PIC</td><td>:</td><td><asp:Label runat="server" id="lblTlpPIC"></asp:Label></td>
        </tr>
        <tr style="display:none">
	        <td>ID</td><td>:</td><td><asp:Label runat="server" id="lblID"></asp:Label></td>
        </tr>

        </table>
        <table class="TableDalam">
            <tr>
            <td style="width:400px">
                <asp:Panel runat="server" ID="pnlJeniskunjungan">
                    <hr />
                </asp:Panel>
                <h2>JENIS KUNJUNGAN</h2>*check the box if yes
            </td>
            </tr>

        </table>
        <table>
            <tr>
                <td>

                    <asp:CheckBoxList id="checkKunjungan" runat="server" OnSelectedIndexChanged="checkKunjungan_SelectedIndexChanged" AutoPostBack="true">
                    <asp:ListItem Value="1">Kunjungan Rutin</asp:ListItem>
                    </asp:CheckBoxList>

                </td>
            </tr>
                <tr>
                <td>

                    <asp:CheckBoxList id="checkTrouble" runat="server" OnSelectedIndexChanged="checkTrouble_SelectedIndexChanged" AutoPostBack="true">
                    <asp:ListItem Value="2">Trouble Cabang/Pos</asp:ListItem>
                    </asp:CheckBoxList>

                </td>
            </tr>
                <tr>
                <td>

                    <asp:CheckBoxList id="checkDeployment" runat="server" OnSelectedIndexChanged="checkDeployment_SelectedIndexChanged"  AutoPostBack="true">
                    <asp:ListItem Value="3">Deployment Unit</asp:ListItem>
                    </asp:CheckBoxList>

                </td>
            </tr>
                <tr>
                <td>
                    <asp:CheckBoxList id="checkLain" runat="server" OnSelectedIndexChanged="checkLain_SelectedIndexChanged" AutoPostBack="true">
                    <asp:ListItem Value="4">Lain-lain</asp:ListItem>
                    </asp:CheckBoxList>

                </td>
            </tr>
            <tr><td>&nbsp;</td></tr>
        </table>
            	<fieldset runat="server" name="grpKunjungan" ID="grpKunjungan" >
				<legend>Kunjungan Rutin</legend>
				<table width="100%">
                    <tr>
                        <td class="KolomKiri">Deskripsi Kunjungan</td>
                        <td style="width:5px">:</td>
                        <td><asp:TextBox id="txtDesKunjungan" TextMode="multiline" Width="90%" Height="100px" runat="server" /></td>
                    </tr>
				</table>
			</fieldset>
    <br />
    <fieldset runat="server" name="grpTrouble" ID="grpTrouble">
				<legend>Trouble Cabang/Pos</legend>
        <table>
        <tr>
            <td>Trouble
            </td>
            <td>
                <asp:TextBox runat="server" id="txtJenisTrouble"></asp:TextBox>
            </td>
            <td>Solusi/Tindakan
            </td>
            <td>
                <asp:TextBox runat="server" ID="txtSolusi"></asp:TextBox></td>
            <td>
                <asp:Button runat="server" ID="btnAdd" Text="Add" />
                &nbsp;&nbsp;<asp:Label ID="lblErrorTrouble" runat="server" ForeColor="Red" Font-Names="Arial"></asp:Label>
            </td>
        </tr>
            </table>
        <asp:GridView runat="server" ID="GridTrouble" AutoGenerateColumns="false" CssClass="grid">
        <Columns>
            <asp:TemplateField HeaderStyle-Width="25px">
                <HeaderTemplate>
                    <input type="checkbox" name="chkSelectAll1" id="chkSelectAll1" onclick="CheckTheCheckBoxes('chk1');" />
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:CheckBox runat="server" ID="chk1" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Jenis Trouble">
                <ItemTemplate>
                    <asp:Label runat="server" ID="lblJenisTrouble" Text='<%# Bind("[JenisTrouble]") %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox runat="server" id="txtJenisTrouble" Text='<%# Bind("[JenisTrouble]") %>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Solusi/Tindakan">
                <ItemTemplate>
                    <asp:Label runat="server" ID="lblSolusi" Text='<%# Bind("Solusi") %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox runat="server" ID="txtSolusi" Text='<%# Bind("Solusi") %>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="ID" HeaderStyle-CssClass="hidden" ItemStyle-CssClass="hidden"
                FooterStyle-CssClass="hidden" />
            <asp:TemplateField HeaderText="Action">
                <ItemTemplate>
                    <asp:Button runat="server" ID="btnEdit" Text="Edit" CommandName="Edit" />
                </ItemTemplate>
                <EditItemTemplate>
                    <table>
                        <tr>
                            <td>
                                <asp:Button runat="server" ID="btnSave" Text="Save" CommandName="Update" />
                            </td>
                            <td>
                                <asp:Button runat="server" ID="btncancel" Text="Cancel" CommandName="Cancel" />
                            </td>
                        </tr>
                    </table>
                </EditItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <br />
    <asp:Button runat="server" ID="btnDelete" Text="Delete" />
			</fieldset>

    <br/>
    <fieldset runat="server" name="grpDeployment" ID="grpDeployment">
				<legend>Deployment Unit</legend>
				<table class="grid" cellspacing="0">
                    <tr>
                        <th>Jenis Unit</th><th>Jumlah Unit</th>
                    </tr>
                    <tr><td align="center">Desktop</td><td align="center">
                        <asp:TextBox ID="txtDesktop" runat="server"></asp:TextBox></td></tr>
                    <tr><td align="center">Notebook</td><td align="center">
                        <asp:TextBox ID="txtNotebook" runat="server"></asp:TextBox></td></tr>
                    <tr><td align="center">ThinClient</td><td align="center">
                        <asp:TextBox ID="txtThinClient" runat="server"></asp:TextBox></td></tr>
				</table>
        <br />
        <asp:GridView runat="server" ID="GridPrinter" AutoGenerateColumns="false" CssClass="grid">
        <Columns>
            <asp:TemplateField HeaderStyle-Width="25px">
                <HeaderTemplate>
                    <input type="checkbox" name="chkSelectAll2" id="chkSelectAll2" onclick="CheckTheCheckBoxes2('chk2');" />
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:CheckBox runat="server" ID="chk2" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Nama Printer">
                <ItemTemplate>
                    <asp:Label runat="server" ID="lblNamaPrinter" Text='<%# Bind("[NamaPrinter]") %>'></asp:Label>
                </ItemTemplate>
                
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Jumlah Printer">
                <ItemTemplate>
                    <asp:Label runat="server" ID="lblJmlPrinter" Text='<%# Bind("JmlPrinter") %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox runat="server" ID="txtJmlPrinter" Text='<%# Bind("JmlPrinter") %>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="ID" HeaderStyle-CssClass="hidden" ItemStyle-CssClass="hidden"
                FooterStyle-CssClass="hidden" />
            <asp:TemplateField HeaderText="Action">
                <ItemTemplate>
                    <asp:Button runat="server" ID="btnEdit2" Text="Edit" CommandName="Edit" />
                </ItemTemplate>
                <EditItemTemplate>
                    <table>
                        <tr>
                            <td>
                                <asp:Button runat="server" ID="btnSave2" Text="Save" CommandName="Update" />
                            </td>
                            <td>
                                <asp:Button runat="server" ID="btncancel2" Text="Cancel" CommandName="Cancel" />
                            </td>
                        </tr>
                    </table>
                </EditItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
        <br />
    <asp:Button runat="server" ID="btnDelete2" Text="Delete" />
			</fieldset>
    <br/>
    <fieldset runat="server" name="grpLain" ID="grpLain">
				<legend>Lain-lain</legend>
				<table width="100%">
                    <tr>
                        <td class="KolomKiri">Deskripsi</td>
                        <td style="width:5px">:</td>
                        <td><asp:TextBox id="txtDesLain" TextMode="multiline"  Width="90%" Height="100px" runat="server" /></td>
                    </tr>
				</table>
			</fieldset>
<br />

<table>
    <tr>
        <td colspan="2"><asp:Label ID="lblError" runat="server" ForeColor="Red" Font-Names="Arial"></asp:Label></td>
    </tr>
    <tr>
        <td style="text-align:right"><asp:Button ID="btnSubmit" runat="server" Text="Submit"/>&nbsp;&nbsp;</td><td style="text-align:left">&nbsp;&nbsp;<asp:Button ID="btnCancel" runat="server" Text="Cancel" /></td>
    </tr>
    </table>
                </td>
            </tr>
</table>
    

</div>
</asp:Content>

<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
Form Kunjungan
</asp:Content>

<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >

</asp:Content>
